<template>
  <el-form label-width="120px" style="margin-top:50px" :model="companyInfo">
    <el-form-item label="公司名称">
      <el-input v-model="companyInfo.name" disabled style="width:400px" />
    </el-form-item>
    <el-form-item label="公司地址">
      <el-input
        v-model="companyInfo.companyAddress"
        disabled
        style="width:400px"
      />
    </el-form-item>
    <el-form-item label="公司电话">
      <el-input
        v-model="companyInfo.companyPhone"
        disabled
        style="width:400px"
      />
    </el-form-item>
    <el-form-item label="邮箱">
      <el-input v-model="companyInfo.mailbox" disabled style="width:400px" />
    </el-form-item>
    <el-form-item label="备注">
      <el-input
        v-model="companyInfo.remarks"
        type="textarea"
        :rows="3"
        disabled
        style="width:400px; resize: none;"
      />
    </el-form-item>
  </el-form>
</template>

<script>
import { getCompanyInfo } from '../../../api/setting'
import { mapGetters } from 'vuex'
export default {
  data() {
    return {
      companyInfo: {}
    }
  },
  computed: {
    // 把公司id合并到计算机属性
    ...mapGetters(['companyId'])
  },
  created() {
    this.getCompanyInfoHeader()
  },
  methods: {
    // 获取公司数据
    async getCompanyInfoHeader() {
      // 获取公司信息
      const formData = await getCompanyInfo(this.companyId)
      // console.log(formData)
      this.companyInfo = formData
    }
  }
}
</script>

<style></style>
